package com.jsp.service;


import java.sql.SQLException;

import com.jsp.bean.DriverBean;
import com.jsp.dao.DriverDao;

public class DriverService {

	
	private DriverBean driverBean;
	private DriverDao driverDao;
	
	public DriverBean inesrt(String name_dr, String age_dr, String tel_dr,
			String address_dr, String idcard_dr, String state_dr) throws SQLException{
		driverBean=new DriverBean(name_dr, age_dr, tel_dr, address_dr, idcard_dr, state_dr);
		driverDao=new DriverDao();
		return driverDao.insert(driverBean);	
		
	}
	public DriverBean delete(String id, String name_dr, String age_dr, String tel_dr,
			String address_dr, String idcard_dr, String state_dr) throws SQLException{
		driverBean=new DriverBean(id, name_dr, age_dr, tel_dr, address_dr, idcard_dr, state_dr);
		driverDao=new DriverDao();
	    return driverDao.delete(driverBean);
	    
	}
	public DriverBean update(String id, String name_dr, String age_dr, String tel_dr,
			String address_dr, String idcard_dr,String state_dr) throws SQLException{
		driverBean=new DriverBean(id, name_dr, age_dr, tel_dr, address_dr, idcard_dr,state_dr);
		driverDao=new DriverDao();
		return driverDao.update(driverBean);
		
	}
}